package com.yenlien.traceyun.business.dao;

import com.yenlien.traceyun.business.entity.ClientOrderDetailed;
import com.yenlien.traceyun.webase.dao.BaseJpaDao;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.Collection;
import java.util.List;

/**
 * @author: bigwangy@sina.com
 * @create: 2020-12-08
 * @description:
 **/
public interface ClientOrderDetailDao extends BaseJpaDao<ClientOrderDetailed> {

    /**
     * 根据订单删除
     *
     * @param orderId
     */
    public void deleteByOrderId(String orderId);

    /**
     * 根据orderId
     *
     * @param orderId
     * @return
     */
    public List<ClientOrderDetailed> findByOrderId(String orderId);

    /**
     * 批量查询
     *
     * @param orderIds
     * @return
     */
    public List<ClientOrderDetailed> findByOrderIdIn(List<String> orderIds);

    /**
     * 批量查询
     *
     * @param orderIds
     * @param pageable
     * @return
     */
    public Page<ClientOrderDetailed> findByOrderIdIn(List<String> orderIds, Pageable pageable);

    /**
     * 批量查询
     *
     * @param batchs
     * @return
     */
    public List<ClientOrderDetailed> findByBatchIn(List<String> batchs);

    public List<ClientOrderDetailed> findBySourceBatchIn(Collection<String> batchs);

    public List<ClientOrderDetailed> findByRelateIdIn(Collection<String> relateIds);

    public List<ClientOrderDetailed> findByRelateIdAndIsOut(String relateId, boolean isout);

}
